package your.company.own;

import java.io.Serializable;

import javax.faces.bean.*;
import org.apache.log4j.Logger;

@ManagedBean(name = "myBean")
@SessionScoped
public class MyBean implements Serializable {

   private static final Logger log = Logger.getLogger(MyBean.class);
   private static final long serialVersionUID = -2403138958014741653L;
   private String name;
   private int number;

   public MyBean() {
      System.out.println("post construct: initialize");
      name = "John";
   }

   public String getName() {
      return name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public int getNumber() {
      return number;
   }

   public void setNumber(int number) {
      this.number = number;
   }

   public void action() {
      log.info("action");
      number++;
      name = "John-"+number;
   }
}
